<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual describes GNU Stow version 2.3.1
(28 July 2019), a program for managing farms of symbolic links.

Software and documentation is copyrighted by the following:

(C) 1993, 1994, 1995, 1996 Bob Glickstein <bobg+stow@zanshin.com>


(C) 2000, 2001 Guillaume Morin <gmorin@gnu.org>


(C) 2007 Kahlil (Kal) Hodgson <kahlil@internode.on.net>


(C) 2011 Adam Spiers <stow@adamspiers.org>

Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.


Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that the
section entitled "GNU General Public License" is included with the
modified manual, and provided that the entire resulting derived work is
distributed under the terms of a permission notice identical to this
one.

Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation
approved by the Free Software Foundation. -->
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Compile-time vs Install-time (Stow)</title>

<meta name="description" content="Compile-time vs Install-time (Stow)">
<meta name="keywords" content="Compile-time vs Install-time (Stow)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index.html#Index" rel="index" title="Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="index.html#Top" rel="up" title="Top">
<link href="GNU-Emacs.html#GNU-Emacs" rel="next" title="GNU Emacs">
<link href="Resource-Files.html#Resource-Files" rel="prev" title="Resource Files">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en">
<a name="Compile_002dtime-vs-Install_002dtime"></a>
<div class="header">
<p>
Next: <a href="Bootstrapping.html#Bootstrapping" accesskey="n" rel="next">Bootstrapping</a>, Previous: <a href="Resource-Files.html#Resource-Files" accesskey="p" rel="prev">Resource Files</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Compile_002dtime-vs-Install_002dtime-1"></a>
<h2 class="chapter">12 Compile-time vs Install-time</h2>

<p>Software whose installation is managed with Stow needs to be installed
in one place (the package directory, e.g. <samp>/usr/local/stow/perl</samp>)
but needs to appear to run in another place (the target tree, e.g.,
<samp>/usr/local</samp>).  Why is this important?  What&rsquo;s wrong with Perl, for
instance, looking for its files in <samp>/usr/local/stow/perl</samp> instead
of in <samp>/usr/local</samp>?
</p>
<p>The answer is that there may be another package, e.g.,
<samp>/usr/local/stow/perl-extras</samp>, stowed under <samp>/usr/local</samp>.  If
Perl is configured to find its files in <samp>/usr/local/stow/perl</samp>, it
will never find the extra files in the &lsquo;<samp>perl-extras</samp>&rsquo; package, even
though they&rsquo;re intended to be found by Perl.  On the other hand, if Perl
looks for its files in <samp>/usr/local</samp>, then it will find the
intermingled Perl and &lsquo;<samp>perl-extras</samp>&rsquo; files.
</p>
<p>This means that when you compile a package, you must tell it the
location of the run-time, or target tree; but when you install it, you
must place it in the stow tree.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="GNU-Emacs.html#GNU-Emacs" accesskey="1">GNU Emacs</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Other-FSF-Software.html#Other-FSF-Software" accesskey="2">Other FSF Software</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Cygnus-Software.html#Cygnus-Software" accesskey="3">Cygnus Software</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Perl-and-Perl-5-Modules.html#Perl-and-Perl-5-Modules" accesskey="4">Perl and Perl 5 Modules</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<a name="Advice-on-changing-compilation-and-installation-parameters"></a>
<h3 class="section">12.1 Advice on changing compilation and installation parameters</h3>
<p>Some software packages allow you to specify, at compile-time, separate
locations for installation and for run-time.  Perl is one such package;
see <a href="Perl-and-Perl-5-Modules.html#Perl-and-Perl-5-Modules">Perl and Perl 5 Modules</a>.  Others allow you to compile the
package, then give a different destination in the &lsquo;<samp>make install</samp>&rsquo;
step without causing the binaries or other files to get rebuilt.  Most
GNU software falls into this category; Emacs is a notable exception.
See <a href="GNU-Emacs.html#GNU-Emacs">GNU Emacs</a>, and <a href="Other-FSF-Software.html#Other-FSF-Software">Other FSF Software</a>.
</p>
<p>Still other software packages cannot abide the idea of separate
installation and run-time locations at all.  If you try to &lsquo;<samp>make
install prefix=/usr/local/stow/<var>foo</var></samp>&rsquo;, then first the whole package
will be recompiled to hardwire the <samp>/usr/local/stow/<var>foo</var></samp>
path.  With these packages, it is best to compile normally, then run
&lsquo;<samp>make -n install</samp>&rsquo;, which should report all the steps needed to
install the just-built software.  Place this output into a file, edit
the commands in the file to remove recompilation steps and to reflect
the Stow-based installation location, and execute the edited file as a
shell script in place of &lsquo;<samp>make install</samp>&rsquo;.  Be sure to execute the
script using the same shell that &lsquo;<samp>make install</samp>&rsquo; would have used.
</p>
<p>(If you use GNU Make and a shell [such as GNU bash] that understands
<code>pushd</code> and <code>popd</code>, you can do the following:
</p>
<ol>
<li> Replace all lines matching &lsquo;<samp>make[<var>n</var>]: Entering directory
<var>dir</var></samp>&rsquo; with &lsquo;<samp>pushd <var>dir</var></samp>&rsquo;.
</li><li> Replace all lines matching &lsquo;<samp>make[<var>n</var>]: Leaving directory
<var>dir</var></samp>&rsquo; with &lsquo;<samp>popd</samp>&rsquo;.
</li><li> Delete all lines matching &lsquo;<samp>make[<var>n</var>]: Nothing to be done for
<var>rule</var></samp>&rsquo;.
</li></ol>

<p>Then find other lines in the output containing <code>cd</code> or <code>make</code>
commands and rewrite or delete them.  In particular, you should be able
to delete sections of the script that resemble this:
</p>
<div class="example">
<pre class="example">for i in <var>dir_1</var> <var>dir_2</var> <span class="roman">&hellip;</span>; do \
  (cd $i; make <var>args</var> <span class="roman">&hellip;</span>) \
done
</pre></div>

<p>Note, that&rsquo;s &ldquo;should be able to,&rdquo; not &ldquo;can.&rdquo;  Be sure to modulate
these guidelines with plenty of your own intelligence.
</p>
<p>The details of stowing some specific packages are described in the
following sections.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">&bull; <a href="GNU-Emacs.html#GNU-Emacs" accesskey="1">GNU Emacs</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Other-FSF-Software.html#Other-FSF-Software" accesskey="2">Other FSF Software</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Cygnus-Software.html#Cygnus-Software" accesskey="3">Cygnus Software</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Perl-and-Perl-5-Modules.html#Perl-and-Perl-5-Modules" accesskey="4">Perl and Perl 5 Modules</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr>
<div class="header">
<p>
Next: <a href="Bootstrapping.html#Bootstrapping" accesskey="n" rel="next">Bootstrapping</a>, Previous: <a href="Resource-Files.html#Resource-Files" accesskey="p" rel="prev">Resource Files</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>
